<?
layout("/inc/win_layout.html",{title:sysTitle}){
    ?>
<!--BEGIN CONTENT-->
<link rel="stylesheet" href="static/uploadify/uploadify.css" type="text/css"></link>
<script type="text/javascript" src="static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="static/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" src="static/utf8-jsp/ueditor.all.js"></script>
<script type="text/javascript" src="static/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="static/utf8-jsp/third-party/video-js/video.js"></script>
<div class="row" style="min-height: auto;">
	<div class="col-lg-12">
		<div class="panel">
			<div class="panel-body pan" style="height:707px;">
				<form action="./generalWordImportTempletdownload.do" method="post" name="aa" target="_blank" class="form-horizontal">
				<input id="downdd" name="downdd" value="" type="hidden"/>
					<div class="form-body pal"
						style="width:auto; height: auto; margin-bottom: 0px;">
						<div style="width:350px;  margin-left:22px;padding-bottom: 10px;">
							<label for="inputUsername" class="col-md-3 control-label">导入类型
								<span class='require' id="leixing">*</span> </label>
							<div class="col-md-9">
								<div class="input-icon">
									<select id="importType" class="form-control">
										<option value="xml">xml</option>
									</select>
								</div>
							</div>
						</div>
						<div class="col-md-12" style="margin-top: 20px;">
							<label for="inputUsername" class="col-md-3 control-label">选择文件
								<span class='require' id="zhongwenName">*</span> </label>
							<div class="col-md-9" style="margin-top: -15px;">
								<div class="input-group input-group-sm mbs">
									<br> 
									 <span class="input-group-btn">
										<button onclick="upFiles()" type="button" data-toggle="dropdown"
											class="btn btn-success dropdown-toggle">上传...</button>
									 </span>
								</div>
								<textarea id="uploadImage" name="uploadImage" style="width:200px; height:200px;" ></textarea>
								<div id="filepathpp"></div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

	 
<!--END CONTENT-->

<?} ?>

<script>
	var tt;
	var _editor;
	$(function() {
		_editor = UE.getEditor('uploadImage');
	    _editor.ready(function (){
	        //设置编辑器不可用(事实上不可以设置不可用...所以注释掉,以观后效)
	        _editor.setDisabled();
	        //隐藏编辑器,因为只使用上传功能
	        _editor.hide();
	        //侦听图片上传
	  	 	_editor.addListener('beforeInsertImage',function(t,arg){
	  	 		
	        });
	        //侦听文件上传
		   	 _editor.addListener('afterUpfile',function(t,arg){
		   	 	for(var i=0;i<arg.length;i++){
	  	 			var urlFile = arg[i].url;
	  	 			falg = 1;
					document.getElementById('filepathpp').innerHTML = '文件上传成功！<a href="'+urlFile+'" download="w3logo"><img src="static/images/wj.jpg" width="30" height="30" /></a>';
					tt = urlFile;
	  	 		}
		   	 });
	   });
	});
	 //上传文件
	function upFiles() {
		var myFiles = _editor.getDialog("attachment");
	   	myFiles.open();
	}
	function start() {
		if (tt != null && tt != "") {
			$.ajax({
				type : "post",
				url : "./classImportdownload.do",
				data : {
					"id" : tt
				},
				dataType : "json",
				success : function(data) {
					if (data.result == "ok") {
						var index = parent.layer.getFrameIndex(window.name);
						window.parent.onClick();
						window.parent.xianshidata();
						parent.layer.msg('导入成功');
						parent.layer.close(index);
					} else {
						alert(data.result);
					}
				},
				error : function(data) {
					alert("请求失败");
				}
			});
		} else {
			alert("请先上传文件！在导入。。");
		}
	}
</script>